#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>

using namespace std;

#define MAXN 10005
typedef struct
{
   //string elem;
   char elem[MAXN];
   int length;
}SList;
SList  L[MAXN], S; //L是字典，S是要检测的词 
int n = 0, m = 0;

bool cmp(char s[], char t[])
{

   if (strlen(s) != strlen(t)) return false;
   else
   {
       for (int i = 0; i < strlen(s); i++)
       {
           if (s[i] != t[i])return false;
       }
       return true;
   }
}

void Init(SList S)
{
   //flag是标志，若flag = true完全匹配，直接输出correct，若flag = false则说明没有完全匹配，要寻找近似项，
   bool flag = true;
  // 先判断待检测词是否完全匹配
   for (int i = 0; i < n; i++) 
   {
       /*if (cmp(L[i].elem, S.elem))
       {
           printf("%s is correct\n", S.elem);
           flag = false;
           break;
       }*/
       if (strcmp(L[i].elem, S.elem) == 0)
       {
           printf("%s is correct\n", S.elem);
           flag = false;
           break;
       }
   }
   int cnt = 0; //计数
   if (flag)
   {
       printf("%s:", S.elem);

       //第一类：匹配在任意插入一个‘a-'z'字符的近似项
       for (int i = 0; i < n; i++)
       {
           if (S.length == L[i].length + 1)
           {
               cnt = 0; 
               for (int j = 0, k = 0; L[i].elem[j] != '\0'; j++, k++)  
               {
                   if (L[i].elem[j] != S.elem[k])//记录有几个字符不匹配
                   {
                       cnt++;
                       j--;    //用于比较的匹配字符的那个字母不变，为了应对have与behave的类似情况匹配
                   }
                   if (cnt >= 2) //超过2就不比较
                       break;
               }
               if (cnt < 2)  printf(" %s", L[i].elem);  //输出符合条件的字符
           }
       
           //第二类：匹配删除任意一个字符的近似项
           if (S.length == L[i].length - 1) 
           {
               cnt = 0;  //初始化
               for (int j = 0, k = 0; S.elem[k] != '\0'; j++, k++) 
               {
                   if (L[i].elem[j] != S.elem[k]) 
                   {
                       cnt++;
                       k--;
                   }
                   if (cnt >= 2)
                       break;
               }
               if (cnt < 2)
                   printf(" %s", L[i].elem);
           }
        
           //第三类：匹配取代任意位置一个字符的相似项
           if (S.length == L[i].length) 
           {
               cnt = 0;
               for (int j = 0, k = 0; L[i].elem[j] != '\0'; j++, k++)
               {
                   if (L[i].elem[j] != S.elem[k]) 
                       cnt++;
                   if (cnt >= 2)  break;
               }
               if (cnt < 2)  printf(" %s", L[i].elem);
           }
       }
       cout << endl;
   }

}
int main()
{
   while (true)//截止
   {
       cin >> L[n].elem;
       if (L[n].elem[0] == '#')
           break;
       L[n].length = strlen(L[n].elem);
       n++;
   }
   while (true)
   {
       cin >> S.elem;
       if (S.elem[0] == '#')
           break;
       S.length = strlen(S.elem);
       Init(S);
   }
   return 0;
}



////数据测试：
//i
//is
//has
//have
//be
//my
//more
//contest
//me
//too
//if
//award
//#
//me
//aware
//m
//contest
//hav
//oo
//or
//i
//fi
//mre
//#
//
//
////答案匹配：
//me is correct
//aware : award
//m : i my me
//contest is correct
//hav : has have
//oo : too
//or :
//i is correct
//fi : i
//mre : more me